function flashCode(objct) {
    $(objct).attr("src", "http://localhost:8080/code?date="+new Date());
}

function login() {
    let da={
        username:$("#username").val(),
        password:$("#password").val(),
        code:$("#code").val(),
    };
    let data=myAjax("/login",da,"post");
    if (data.result==1) {
        window.open("back/manage.html");
    }else if (data.result==0) {
        alert("登录失败，用户名或者密码不正确请重新输入")
    }else if (data.result==-1) {
        alert("验证码错误")
    }
}

//回车键触发事件
document.onkeydown =cdk;
function cdk(){
    if(event.keyCode ==13){
        login();
    }
}